package com.witframework.web.tag.tab;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTagSupport;

public class panelTag extends BodyTagSupport  implements tabbedpanel{
  private String className = "cjdfltpnlclss";
  private boolean enabled = true;
  private boolean selected = false;
  private String script = null;
  private boolean cond = true;
  PanelTab tab = null;
  PanelBody panel = null;

  public void setClassName(String paramString)  {
    this.className = paramString;
  }

  public String getClassName()  {
    return this.className;
  }

  public void setEnabled(boolean paramBoolean)  {
    this.enabled = paramBoolean;
  }

  public boolean getEnabled()  {
    return this.enabled;
  }

  public void setSelected(boolean paramBoolean)  {
    this.selected = paramBoolean;
  }

  public boolean getSelected()  {
    return this.selected;
  }

  public void setTab(PanelTab paramPanelTab)  {
    this.tab = paramPanelTab;
  }

  public PanelTab getTab()  {
    return this.tab;
  }

  public void setPanel(PanelBody paramPanelBody)  {
    this.panel = paramPanelBody;
  }

  public PanelBody getPanel()  {
    return this.panel;
  }

  public void setScript(String paramString)  {
    this.script = paramString;
  }

  public String getScript()  {
    return this.script;
  }

  public void setCond(boolean paramBoolean)  {
    this.cond = paramBoolean;
  }

  public boolean getCond()  {
    return this.cond;
  }

  public int doAfterBody()    throws JspException  {
    BodyContent localBodyContent = getBodyContent();
    if (this.cond)
    {
      tabpanelTag localtabpanelTag = (tabpanelTag)findAncestorWithClass(this, tabpanelTag.class);
      if (localtabpanelTag == null)
        throw new JspException("tabpanel: Could not find ancestor for Panel");
      if (this.tab == null)
        throw new JspException("tabpanel: Could not find tab for Panel");
      if (this.panel == null)
        throw new JspException("tabpanel: Could not find body for Panel");
      Panel localPanel = new Panel();
      localPanel.setPanelTab(this.tab);
      localPanel.setPanelBody(this.panel);
      localPanel.setClassName(this.className);
      localPanel.setEnabled(this.enabled);
      localPanel.setSelected(this.selected);
      if (this.script != null)
        localPanel.setScript(this.script);
      localtabpanelTag.addPanel(localPanel);
    }
    localBodyContent.clearBody();
    return 0;
  }

  public int doEndTag()  {
    dropData();
    return 6;
  }

  public void release()  {
    dropData();
  }

  private void dropData()  {
    this.className = "cjdfltpnlclss";
    this.enabled = true;
    this.selected = false;
    this.tab = null;
    this.panel = null;
    this.script = null;
    this.cond = true;
  }
}